/*
 * package com.gwtapps.multisearch.client;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.Window;
import com.gwtapps.client.util.JSONRequest;
import com.gwtapps.client.util.JSONRequestHandler;
import com.gwtapps.multisearch.client.model.SearchEngine;
import com.gwtapps.multisearch.client.model.SearchEngineResult;
import com.gwtapps.multisearch.client.view.MultiSearchView;

public class YahooSearcher extends Searcher implements JSONRequestHandler {
	
	public YahooSearcher( MultiSearchView view ){
		super( view, new SearchEngine( "Yahoo Search", "http://www.yahoo.com" ) );
	}
	
	public void query( String q ){
		JSONRequest.get( "http://search.yahooapis.com/VideoSearchService/V1/videoSearch?appid=ZVn4ZuTV34Ejt.kelSEKJFKbAJzBSNRqT76n2MVmPZMJ9wK6yAILOs3v.Oa8yAA-&query="+q+"&output=json&callback=", this  );
		getView().clearResults();
	}
	
	public void onRequestComplete( JavaScriptObject json ){
		JSONObject j = new JSONObject(json);
		JSONObject feed = (JSONObject)j.get("ResultSet");
		//total result//
		
		
		//Window.alert(totalResult.stringValue());
		
		JSONArray entries = (JSONArray)feed.get("Result");
		
		
		for( int i=0; i< entries.size(); ++i ){
			JSONObject entry = (JSONObject)entries.get(i);
			
			
			//title//
			JSONString title = (JSONString)entry.get("Title");
			
			
			//watch link//
			JSONString link = (JSONString)entry.get("Url");
			
			//description//
			
			JSONString content = (JSONString)entry.get("Summary");
			
			//author
			
			String author = "";
			
			//published date//
			
			String published = "";
			
//			mediaGroup//
			//JSONObject mediaGroupObj = (JSONObject)entry.get("media$group");
			
			//category
			String category = "";
			
			
			
			
			//keywords//
			//JSONObject keywordsObj = (JSONObject)mediaGroupObj.get("media$keywords");
			String keywords = "";
			
			
			
			//viewCount
			
			String viewCount = "";
			
			
			//favoriteCount
			String favoriteCount = "";
			
			//numRaters
			
			String numRaters = "";
			
			//average
			String average = "";
			
			
			
			
			if( link != null ){
				getView().addSearchResult(
						new SearchEngineResult( title.stringValue(),link.stringValue(), content.stringValue(),author,published, category, keywords, viewCount,favoriteCount,numRaters, average));
			}
		}
	}
}
*/
